<script setup lang="ts">
import { ref } from "vue";

const tabName = ref<String>("home");
const tabList = ref<Array<String>>(["home", "solution", "business", "about"]);
const tabMap = ref<Map<String, String>>(
  new Map([
    ["home", "首页"],
    ["solution", "解决方案"],
    ["business", "赋能业务"],
    ["about", "关于我们"],
  ])
);
</script>

<template>
  <!--导航栏-->
  <div class="header">
    <div class="cell header__content">
      <div class="cell-hd header__content__logo">
        <img src="../../assets/images/home/logo.png" />
      </div>
      <div class="cell-bd header__content__nav">
        <ul>
          <li v-for="item in tabList" :key="String(item)" :class="{active: tabName === item}" @click="tabName = item">{{tabMap.get(item)}}</li>
        </ul>
      </div>
      <!--预留-->
      <!--<div class="header__user">-->
      <!--  <div class="header__user__login">登录</div>-->
      <!--  <div class="header__user__register">注册</div>-->
      <!--</div>-->
    </div>
  </div>
</template>

<style scoped lang="scss">
.header{
  height: 80px;
  background-color: #fff;
  box-shadow: 0 0 10px rgba(0,0,0,.1);
  *{
    transition: all .1s ease-in-out;
  }
  &__content{
    height: 100%;
    margin: 0 auto;
    padding: 0px 43px;
    &__logo{
      height: 100%;
      img{
        width: 129px;
        position: relative;
        top: 50%;
        transform: translateY(-50%);
      }
    }
    &__nav{
      ul{
        display: flex;
        align-items: center;
        list-style: none;
        padding-left: 40px;
        li{
          margin: 0 20px;
          padding: 0 27px;
          cursor: pointer;
          font-size: 21px;
          color: #2D2D2D;
          height: 80px;
          line-height: 80px;
          &:hover{
            color: #126EF8;
          }
          &.active{
            color: #126EF8;
            position: relative;
            font-weight: bold;
            &:after{
              content: " ";
              position: absolute;
              display: inline-block;
              bottom: 0;
              left: 0;
              width: 100%;
              height: 4px;
              background-color: #126EF8;
              border-radius: 2px;
              box-shadow: 0 0 10px rgba(18,110,248,.4);
            }
            //border-bottom: 4px solid rgba(31, 116, 243, 0.9)
          }
        }
      }
    }
  }
}
</style>
